package com.vueblog.service.impl;

import com.vueblog.dao.AnimeDao;
import com.vueblog.po.Anime;
import com.vueblog.service.AnimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnimeServiceImpl implements AnimeService {
    @Autowired
    private AnimeDao animeDao;
    @Override
    public int saveAnime(Anime anime) {
        return animeDao.saveAnime(anime);
    }

    @Override
    public int deleteAnime(int id) {
        return animeDao.deleteAnime(id);
    }

    @Override
    public int updateAnime(Anime anime) {
        return animeDao.updateAnime(anime);
    }

    @Override
    public List<Anime> findAllAnime() {
        return animeDao.findAllAnime();
    }

    @Override
    public List<Anime> findAnimeByName(String keyword) {
        return animeDao.findAnimeByName("%"+keyword+"%");
    }

    @Override
    public Anime getAnimeById(int id) {
        return animeDao.getAnimeById(id);
    }
}
